#!/bin/bash

function rand() {
    min=$1
    max=$(($2-$1+1))
    num=`date +%s%N`
    echo $(($num%$max+$min))
}

chns=('02' '03' '1006' '1007')
props=(0 1010 1012 1013 1014 1001 1002)

while read line
do
    USER=$line
    VER=`rand 70 90`
    RANDOM=`date +%s%N`    
    IDX=$(($RANDOM%${#chns[*]}))
    CHN=${chns[$IDX]}
    IDX=$(($RANDOM%${#props[*]}))
    PROP=${props[$IDX]}
    NUM=`rand 1000 10000`
    CMD="192.168.2.182:8000/props?source=1&uid=${USER}&channel=${CHN}&ver=${VER}&items=${PROP}|${NUM}"
    curl ${CMD}
    usleep 3000
done < uids.txt
